package com.jiang.专题.动态规划.Q1025;

/**
 * @author Jiang
 * @version 1.0
 * @date 2025/02/28 14:53
 */
class Solution {
    public boolean divisorGame(int n) {
        boolean[] dp = new boolean[n + 2];
        dp[1] = false;
        dp[2] = true;
        for (int i = 3; i <= n; i++) {
            for (int j = 1; j < i; j++) {
                if ((i % j == 0) && !dp[i - j]) {
                    dp[i] = true;
                    break;
                }
            }
        }
        return dp[n];
    }
}
